<?php
 /**
 * Created by PhpStorm.
 * @package    art
 * @copyright  Copyright (c) 2013 LaZaDa SEA
 * @author     long.nguyen-thanh <long.nguyen-thanh@lazada.com
 * @date       5/20/14 5:28 PM
 * @ID         $Id$,${Id}
 */


$linkPost = $this->cmsUrl(array('action'=>'index'));


$full_name 		= $this->formText('full_name',$this->Item['full_name'],array('class'=>'form-control', 'placeholder' => 'Full name'));
$website 		= $this->formText('website',$this->Item['website'],array('class'=>'form-control', 'placeholder' => 'Website'));
$country 		= $this->formText('country',$this->Item['country'],array('class'=>'form-control', 'placeholder' => 'Country'));
$email 		    = $this->formText('email',$this->Item['email'],array('class'=>'form-control', 'placeholder' => 'Email'));
$city 		    = $this->formText('city',$this->Item['city'],array('class'=>'form-control', 'placeholder' => 'City'));
$cat_id			= $this->Item['cat_id'];


$arrRow = array(
    array('label'=>$this->translate('Full Name'),'input'=>$full_name),
    array('label'=>$this->translate('Website'),'input'=>$website, 'align' => 'horizontal'),
    array('label'=>$this->translate('Country'),'input'=>$country, 'align' => 'horizontal'),
    array('label'=>$this->translate('Email'),'input'=>$email, 'align' => 'horizontal'),
    array('label'=>$this->translate('City'),'input'=>$city, 'align' => 'horizontal')
);

?>
<div class="row">
    <div class="box">
        <div class="col-md-10 col-md-offset-1 list-error" id="list-error" style="display: none"></div>
        <h3 style="margin: 0px 0px 20px 0px; text-align: center">ADVANCED ARTSERV SEARCH</h3>
        <h5 style="margin: 0px 0px 20px 15px; text-align: left;font-weight: bold">[INPUT INFO RELATED TO SEARCH SUBJECT]</h5>

        <form class="form-horizontal appFormSearch" role="form" id="appForm" name="appForm" action="<?php echo $linkPost?>" method="post">
            <?php
            $html = '';
            $i = 0;
            foreach($arrRow as  $val){
                $i++;
              	$style = '';
				$styleLbl = '';
				if($i == 1){
                    $style = ' style="width: 29.5%;"';
                    $styleLbl = ' style="padding-left: 30px"';
                }
                $clssDiv = 'form-group has-feedback frm-input';
                $clssLabel = 'col-sm-2 control-label';
                $clssDivInput = 'col-sm-4 column-input-4';
                if(@$val['align'] == 'horizontal'){
                    $clssDiv .= ' col-md-6';
                    $clssLabel = 'col-md-4 col-xs-2 control-label';
                    $clssDivInput .= ' column-input-4';
                }
                $html.= '<div class="' . $clssDiv . '">
	                            <label class="' . $clssLabel . '" ' . $styleLbl . '>' . $val['label'] . '</label>
	                            <div class="' . $clssDivInput . '" ' . $style . '>' . $val['input'] . '</div>
	                        </div>';
            }
            echo $html;
            ?>
            <div class="form-group">
                <label id="lblGroup" for="full_name" class="col-sm-5 control-label" style="padding-left: 30px">OCCUPATION [CHECK ALL THAT APPLY]</label>
            </div>
            <div class="form-group">
                <div class="col-sm-11" style="margin-left: 17px;" id="ckbGroup">
                    <?php
                    if(!empty($this->slbCategory)){
                        $html = '';
                        foreach($this->slbCategory as  $val){
                            $checked = '';
                            if(@in_array($val['id'],$cat_id)) $checked = 'checked="checked"';
                            $html.= '<div class="checkbox col-sm-3">
									    <label>
									      <input type="checkbox" '.$checked.' attr="'.$val['name'].'" name="cat_id[]" value="'.$val['id'].'" />'.$val['name'].'
									    </label>
									  </div>';
                        }
                        echo $html;
                    }
                    ?>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-9" style="text-align: right;margin-top: 20px;">
                    <button type="submit" class="btn btn-default bg-blue">SUBMIT</button>
                </div>
            </div>
        </form>
    </div>
</div>


<script>
    $(function(){
        $(".fancybox-inner").niceScroll();
    })
</script>